home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 1997 December / PC Pro December 1997 CD-Rom coverdisc.iso / symantec / dbAnywh / JAVA.BIN / CLASSES.ZIP / sun / tools / asm / SwitchData.class (.txt) < prev    next >
Encoding:
Java Class File  |  1996-12-14  |  1.3 KB  |  45 lines

  1. package sun.tools.asm;
  2.  
  3. import java.util.Enumeration;
  4. import java.util.Hashtable;
  5.  
  6. public final class SwitchData {
  7.    int minValue;
  8.    int maxValue;
  9.    Label defaultLabel = new Label();
  10.    Hashtable tab = new Hashtable();
  11.  
  12.    public Label get(int var1) {
  13.       return (Label)this.tab.get(new Integer(var1));
  14.    }
  15.  
  16.    public Label get(Integer var1) {
  17.       return (Label)this.tab.get(var1);
  18.    }
  19.  
  20.    public void add(int var1, Label var2) {
  21.       if (this.tab.size() == 0) {
  22.          this.minValue = var1;
  23.          this.maxValue = var1;
  24.       } else {
  25.          if (var1 < this.minValue) {
  26.             this.minValue = var1;
  27.          }
  28.  
  29.          if (var1 > this.maxValue) {
  30.             this.maxValue = var1;
  31.          }
  32.       }
  33.  
  34.       this.tab.put(new Integer(var1), var2);
  35.    }
  36.  
  37.    public Label getDefaultLabel() {
  38.       return this.defaultLabel;
  39.    }
  40.  
  41.    public synchronized Enumeration sortedKeys() {
  42.       return new SwitchDataEnumeration(this.tab);
  43.    }
  44. }
  45.